package com.huanying.goodjob.advertisment;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.huanying.goodjob.community.Area;

@Entity
@Table(name = "advertisment")
public class Advertisment {
	private static final long serialVersionUID = -8714406550574846572L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private int id;
	private String title;
	private String img_url;//广告图片路径
	private String content;//广告文字内容
	@OneToOne(cascade = CascadeType.REFRESH, optional = true)
	@JoinColumn(name = "city_code")
	private Area city;  //城市

	@OneToOne(cascade = CascadeType.REFRESH, optional = true)
	@JoinColumn(name = "province_code")
	private Area province;//省
	@OneToOne(cascade = CascadeType.REFRESH, optional = true)
	@JoinColumn(name = "county_code")
	private Area county;//县和区
	public Area getCity() {
		return city;
	}
	public void setCity(Area city) {
		this.city = city;
	}
	public Area getProvince() {
		return province;
	}
	public void setProvince(Area province) {
		this.province = province;
	}
	public Area getCounty() {
		return county;
	}
	public void setCounty(Area county) {
		this.county = county;
	}
	@Column(name = "status", nullable = false, columnDefinition = "INT default 1")
	private int status;
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getImg_url() {
		return img_url;
	}
	public void setImg_url(String img_url) {
		this.img_url = img_url;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public int getStatus() {
		return status;
	}
	public void setStatus(int status) {
		this.status = status;
	}
	public static long getSerialversionuid() {
		return serialVersionUID;
	} 
}
